syntax enable
" set ft=html
set tw=78
set nobk
set hlsearch
set ruler
set nowrap
set autoindent
set expandtab
" set smarttab " maybe busted things for Python?
set shiftwidth=4
set softtabstop=4
set tabstop=4
" funny backspacing to allow backspace in insert mode
" ..just use Ctrl-h in insert mode instead.
" set backspace=2
"set ignorecase " this got to be too much of a pain
"set sidescrolloff=10 " this, too
" set so=9999
" set noso

"set textwidth=69 " for nice plaintext 'gq' formatting

" both of these lines are needed for <F12> to get in and out of paste
" mode while in insert mode
imap <F12> <ESC>:set invpaste<CR>i
set pastetoggle=<F12>

"" window toggling
set winminheight=0
nmap <M-k> <C-W>r<C-W>k:resize<CR>
nmap <M-j> <C-W>j<C-W>R:resize<CR>
imap <M-k> <ESC><M-k>i
imap <M-j> <ESC><M-j>i
map <F5> :bp!<CR>
"imap <F5> <esc>:bp!<CR>
"set winminheight=0
"map <C-j> <C-W>j<C-W>_ " go down a window
"map <C-k> <C-W>k<C-W>_ " go up a window

" hopefully this gets read after all the plugins resets the python
" fold-method after tagexplorer messes with it (i don't wanna edit
" the plugins)
" setlocal foldmethod=expr
" setlocal foldexpr=GetPythonFold(v:lnum)
" setlocal foldtext=PythonFoldText()
set foldmethod=indent
set foldnestmax=2

" rot13 the file
map <F9> ggVGg?

" run the current buffer through python
" this will open a new buffer called 'output'
" holds the, um, output. this buffer can be
" written to a file (disable by adding a
" ':set buftype=nofile' right after the buffer
" has been created
map <F4> :w<CR>:let @a = system('`which python` ' . bufname('%'))<CR>:silent botright new output<CR>:silent normal "aP<CR>

" preserve syntax highlighting
autocmd BufEnter * :syntax sync fromstart
" uncomment minlines to set amount of previous lines to look at for
" highlighting if refresh becomes choppy
" syn sync minlines=200
